<template>
  <div class="handerBox d-flex justify-content-between align-items-center">
    <div class="logoAndTitle d-flex align-items-center">
      <img src="../assets/logo.png" alt="vue" :style="{ width: `${60}px`, height:  `${60}px`, marginRight:  `${10}px` }">
      <span class="text-light" style="font-size: 20px;">电商后台管理系统</span>
    </div>
    <div class="btnBox" :style="{ height:  `${40}px` }">
      <el-button type="info" @click="outClick">退出</el-button>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'

export default defineComponent({
  name: 'Header',
  setup () {
    const router = useRouter()
    const outClick = () => {
      localStorage.removeItem('token')
      router.push({ path: '/login' })
    }
    return { outClick }
  }
})
</script>
